package com.wang.Test;

import com.wang.entity.Hello;
import org.omg.CORBA.portable.ApplicationException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author 19225
 * @create 2020/11/25 12:05
 */
public class test {
    public static void main(String[] args) {
        //解析bean.xml文件，管理相应的Bean对象
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        //getBean : 参数即为spring配置文件中bean的id . id可以在xml里面随便取名
        Hello hello = (Hello)context.getBean("a");
        hello.show();
    }

}
